package com.hkbigdata.springbootdemo.service.impl;

import com.hkbigdata.springbootdemo.bean.Employee;
import com.hkbigdata.springbootdemo.mapper.EmployeeMapper;
import com.hkbigdata.springbootdemo.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liuanbo
 * @creat 2024-11-08-11:07
 * @see 2194550857@qq.com
 */
//实现方法：alt+enter
@Service
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    EmployeeMapper employeeMapper;
    @Override
    public List<Employee> findAll() {
        System.out.println("开始处理核心业务逻辑");
        List<Employee> all = employeeMapper.findAll();
        return all;
    }

    @Override
    public Employee findById(Integer id) {
        System.out.println("开始处理核心业务逻辑");
        Employee mapperById = employeeMapper.findById(id);
        return mapperById;
    }

    @Override
    public void add(Employee employee) {
        System.out.println("开始处理核心业务逻辑");
        employeeMapper.add(employee);
    }

    @Override
    public void deleteById(Integer id) {
        System.out.println("开始处理核心业务逻辑");
        employeeMapper.delete(id);
    }

    @Override
    public void update(Employee employee) {
        System.out.println("开始处理核心业务逻辑");
        employeeMapper.update(employee);
    }
}
